function g1 = static_g1(T, y, x, params, T_flag)
% function g1 = static_g1(T, y, x, params, T_flag)
%
% File created by Dynare Preprocessor from .mod file
%
% Inputs:
%   T         [#temp variables by 1]  double   vector of temporary terms to be filled by function
%   y         [M_.endo_nbr by 1]      double   vector of endogenous variables in declaration order
%   x         [M_.exo_nbr by 1]       double   vector of exogenous variables in declaration order
%   params    [M_.param_nbr by 1]     double   vector of parameter values in declaration order
%                                              to evaluate the model
%   T_flag    boolean                 boolean  flag saying whether or not to calculate temporary terms
%
% Output:
%   g1
%

if T_flag
    T = model_5_IRFs.static_g1_tt(T, y, x, params);
end
g1 = zeros(46, 46);
g1(1,35)=1;
g1(1,39)=(-T(47));
g1(2,16)=(-T(26));
g1(2,37)=1;
g1(2,39)=(-T(25));
g1(2,43)=(-T(27));
g1(3,16)=(-T(29));
g1(3,36)=1;
g1(3,39)=(-T(28));
g1(3,43)=(-T(30));
g1(4,16)=(-T(32));
g1(4,38)=1;
g1(4,39)=(-T(31));
g1(4,43)=(-T(33));
g1(5,9)=(-(T(5)*(y(35)*params(10)*(1-params(9))+y(36)*(1-params(8))*params(12)*params(9)*params(10)+y(37)*params(14)*params(9)*params(10))));
g1(5,16)=(-(params(1)/y(32)*(1-params(4))*T(6)));
g1(5,32)=(-1)/(y(32)*y(32))-(T(6)*y(16)*(1-params(4))*(-params(1))/(y(32)*y(32))+(-(params(1)*(1-params(8))))/(y(32)*y(32)));
g1(5,35)=(-(T(5)*y(9)*params(10)*(1-params(9))));
g1(5,36)=(-(T(5)*params(12)*params(9)*y(9)*params(10)*(1-params(8))));
g1(5,37)=(-(T(5)*params(14)*params(9)*y(9)*params(10)));
g1(6,28)=1;
g1(7,16)=(-(params(3)*1/y(46)/(1-params(3))*T(34)));
g1(7,32)=1;
g1(7,46)=(-(params(3)*T(34)*(-y(16))/(y(46)*y(46))/(1-params(3))));
g1(8,18)=getPowerDeriv(y(18),(-params(2)),1);
g1(8,32)=(-((-(params(6)/(1-params(5))))/(y(32)*y(32))));
g1(9,16)=(-(y(27)*T(35)));
g1(9,27)=(-T(8));
g1(9,32)=y(40)/params(6);
g1(9,40)=y(32)/params(6);
g1(9,43)=(-(y(27)*T(36)));
g1(10,9)=1;
g1(10,40)=(-(0.5*1/y(40)/params(21)/1.414213562373095*2/(exp(T(9)^2)*1.772453850905516)));
g1(11,21)=1;
g1(11,40)=(-T(48));
g1(12,22)=1;
g1(12,44)=(-1);
g1(13,33)=1;
g1(14,22)=(-(1+y(33)));
g1(14,33)=(-(1+y(22)));
g1(14,34)=1;
g1(15,16)=y(39)*(1-params(4));
g1(15,39)=y(16)*(1-params(4));
g1(15,43)=(-(1-params(8)));
g1(16,9)=(-(T(11)*params(10)*y(27)));
g1(16,16)=(-(y(9)*params(10)*y(27)*T(38)));
g1(16,27)=(-(y(9)*params(10)*T(11)));
g1(16,31)=1;
g1(16,39)=(-(y(9)*params(10)*y(27)*T(37)));
g1(16,43)=(-(y(9)*params(10)*y(27)*T(39)));
g1(17,9)=(-(T(12)*params(10)*y(27)));
g1(17,16)=(-(y(9)*params(10)*y(27)*T(41)));
g1(17,27)=(-(y(9)*params(10)*T(12)));
g1(17,30)=1;
g1(17,39)=(-(y(9)*params(10)*y(27)*T(40)));
g1(17,43)=(-(y(9)*params(10)*y(27)*T(42)));
g1(18,19)=y(23);
g1(18,23)=y(31)+y(30)+y(19);
g1(18,30)=y(23)-1;
g1(18,31)=y(23)-1;
g1(19,24)=y(31)+y(30);
g1(19,30)=y(24);
g1(19,31)=y(24)-1;
g1(20,9)=(-(y(35)*params(10)*y(27)+y(38)*params(10)*y(27)));
g1(20,17)=1;
g1(20,27)=(-(params(52)+y(35)*y(9)*params(10)+y(38)*y(9)*params(10)));
g1(20,35)=(-(y(9)*params(10)*y(27)));
g1(20,38)=(-(y(9)*params(10)*y(27)));
g1(21,18)=(-1);
g1(21,20)=1;
g1(21,27)=(-(1-(1-params(8))));
g1(21,45)=(-1);
g1(22,16)=(-(y(17)/(1-params(3))));
g1(22,17)=(-(y(16)/(1-params(3))));
g1(22,20)=1;
g1(23,19)=1;
g1(23,27)=(-(1-(1-params(8))));
g1(24,17)=(-T(14));
g1(24,29)=1;
g1(24,32)=(-(y(17)*y(46)*(-params(3))/(y(32)*y(32))*getPowerDeriv(params(3)/y(32),1/(1-params(3)),1)));
g1(24,46)=(-(y(17)*T(13)));
g1(25,20)=(-1);
g1(25,25)=T(18)*T(15)*T(17);
g1(25,27)=T(18)*T(16)*getPowerDeriv(y(27),1-params(3),1);
g1(25,29)=T(16)*T(17)*getPowerDeriv(y(29),params(3),1);
g1(25,46)=T(18)*T(17)*T(49);
g1(26,25)=(-T(15));
g1(26,26)=1;
g1(26,46)=(-T(49));
g1(27,16)=(-T(44));
g1(27,39)=(-T(43));
g1(27,41)=1;
g1(27,43)=(-T(45));
g1(28,9)=(-(params(10)*T(24)));
g1(28,16)=(-T(22));
g1(28,39)=(-T(21));
g1(28,42)=1;
g1(28,43)=(-T(23));
g1(29,12)=1;
g1(29,32)=(-(1/y(32)-1/(y(32))));
g1(30,8)=1;
g1(30,22)=(-(1/(1+y(22))-1/(1+(y(22)))));
g1(31,14)=1;
g1(32,6)=1;
g1(32,23)=(-(1/y(23)-1/(y(23))));
g1(33,7)=1;
g1(33,24)=(-(1/y(24)-1/(y(24))));
g1(34,15)=1;
g1(34,25)=(-(1/y(25)-1/(y(25))));
g1(35,5)=1;
g1(35,26)=(-(1/y(26)-1/(y(26))));
g1(36,13)=1;
g1(37,1)=1;
g1(37,20)=(-(1/(y(20)+y(32)*y(21)*params(15)-y(45))-1/(y(20)+y(32)*y(21)*params(15)-y(45))));
g1(37,21)=(-(y(32)*params(15)/(y(20)+y(32)*y(21)*params(15)-y(45))-y(32)*params(15)/(y(20)+y(32)*y(21)*params(15)-y(45))));
g1(37,32)=(-(y(21)*params(15)/(y(20)+y(32)*y(21)*params(15)-y(45))-y(21)*params(15)/(y(20)+y(32)*y(21)*params(15)-y(45))));
g1(37,45)=(-((-1)/(y(20)+y(32)*y(21)*params(15)-y(45))-(-1)/(y(20)+y(32)*y(21)*params(15)-y(45))));
g1(38,3)=1;
g1(38,19)=(-(1/y(19)-1/(y(19))));
g1(39,2)=1;
g1(39,18)=(-(1/(y(18)+y(32)*y(21)*params(15))-1/(y(18)+y(32)*y(21)*params(15))));
g1(39,21)=(-(y(32)*params(15)/(y(18)+y(32)*y(21)*params(15))-y(32)*params(15)/(y(18)+y(32)*y(21)*params(15))));
g1(39,32)=(-(y(21)*params(15)/(y(18)+y(32)*y(21)*params(15))-y(21)*params(15)/(y(18)+y(32)*y(21)*params(15))));
g1(40,4)=1;
g1(40,21)=T(46);
g1(40,29)=T(46);
g1(41,11)=1;
g1(41,41)=(-(1/y(41)-1/(y(41))));
g1(42,10)=1;
g1(42,42)=(-(1/y(42)-1/(y(42))));
g1(43,43)=1/y(43)-params(22)*1/y(43);
g1(44,44)=1/(1+y(44))-params(24)*1/(1+y(44));
g1(45,46)=1/y(46)-params(23)*1/y(46);
g1(46,45)=1/y(45)-params(25)*1/y(45);
if ~isreal(g1)
    g1 = real(g1)+2*imag(g1);
end
end
